

#include "stdafx.h"
#include "NCriticalErrorLog.h"
#include "NSyncObject.h"


NCriticalErrorLog* NCriticalErrorLog::m_cpSelf = NULL;

NCriticalErrorLog::NCriticalErrorLog() : NFileLog("logs", "CriticalError", false)
{
	m_bOK = false;
	if(false == NFileLog::isOK()) return;	
	m_bOK = true;
}

NCriticalErrorLog::~NCriticalErrorLog()
{
	
}

bool NCriticalErrorLog::CreateInstance(void)
{
	assert(NULL == m_cpSelf);
	if(NULL != m_cpSelf) return false;
	m_cpSelf = new(nothrow) NCriticalErrorLog();
	if(NULL == m_cpSelf) return false;
	if(false == m_cpSelf->isOK()){ delete m_cpSelf; m_cpSelf = NULL; return false; };
	return true;
}

void NCriticalErrorLog::DestroyInstance(void)
{
	assert(NULL != m_cpSelf);
	if(NULL != m_cpSelf){ delete m_cpSelf; m_cpSelf = NULL; };
}

